//
//  NSKeyedArchiver+ConvertNSData.m
//  NSSecureCodingDemoo
//
//  Created by hpkj on 2020/1/19.
//

#import "NSKeyedArchiver+ConvertNSData.h"



@implementation NSKeyedArchiver (ConvertNSData)
+(NSData *)dataWithCustomClass:(id<NSSecureCoding>)customClass
{
    NSMutableData * data = [NSMutableData data];
    NSError *error = nil;
    data = [NSKeyedArchiver archivedDataWithRootObject:customClass requiringSecureCoding:YES error:&error];
    return [data copy];
}




@end






